<template>
    <view class="section panel m-t">
        <view class="home_title">
            <text class="home_title-modify"></text>
            <text class="home_title-tit">{{title}}</text>
            <text v-if="showMore" class="yticon icon-you" @click="linkMore">更多</text>
        </view>
        <slot></slot>
    </view>
</template>

<script>

    export default {
        props:{
            title:{
                type:String,
                default: ''
            },
            code:{
                type:String,
                default:''
            },
            showMore:{
                type:Boolean,
                default: true
            }
        },
        data() {
            return {}
        },
        watch: {},
        methods: {
			// 想添加跳转链接，需要知道对应的下标或者带参
			linkMore(){
				console.log('linkMore')
				this.$emit('linkMore',this.code);
			}
		}
    }
</script>

<style lang="scss" scoped>
    $main-blue: #3b64ff;
	.yticon {
		font-size: 24upx;
		color: #999;
		float: right;
	}
    .home_title {
        padding: 20upx;
        display: flex;
        flex-direction: row;
		justify-content: space-between;
        &-modify {
            width: 10upx;
            height: 30upx;
            background-color: $main-blue;
            display: inline-block;
        }
        &-right{
            font-size: 30upx;
        }
        &-tit {
            font-size: 30upx;
            color: #333;
            font-weight: 700;
            line-height: 1;
            margin-left: 20upx;
			flex: 1;
        }
    }
</style>
